//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.come.shortcut;

import com.tool.tcpimg.UIUtils;
import org.come.shortcut.XBjczJpanel;
import org.come.until.FormsManagement;
import org.come.until.Music;
import org.come.until.ScrenceUntil;

import javax.swing.*;
import javax.swing.plaf.basic.BasicInternalFrameUI;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.io.File;

public class XBjczJpanelxsjm extends JInternalFrame implements MouseListener {
    private XBjczJpanel xBjczJpanel = new XBjczJpanel();
    private int first_x;
    private int first_y;

    public static XBjczJpanelxsjm getXBjczJpanelxsjm() {
        return (XBjczJpanelxsjm)FormsManagement.getInternalForm(3100).getFrame();
    }

    public XBjczJpanelxsjm() throws Exception {
        this.add(this.xBjczJpanel);
        this.setBorder(BorderFactory.createEmptyBorder());
        ((BasicInternalFrameUI)this.getUI()).setNorthPane((JComponent)null);
        this.setBounds(ScrenceUntil.Screen_x / 2-398, ScrenceUntil.Screen_y / 2-224, 795, 449);
        this.xBjczJpanel.setBounds(0, 0, 795, 449);
        this.pack();
        this.setBackground(UIUtils.Color_BACK);
        this.setVisible(false);
        this.addMouseListener(this);
        this.addMouseMotionListener(new MouseMotionListener() {
            @Override
            public void mouseMoved(MouseEvent e) {
            }

            @Override
            public void mouseDragged(MouseEvent e) {
                if (XBjczJpanelxsjm.this.isVisible()) {
                    int x = e.getX() - XBjczJpanelxsjm.this.first_x;
                    int y = e.getY() - XBjczJpanelxsjm.this.first_y;
                    XBjczJpanelxsjm.this.setBounds(x + XBjczJpanelxsjm.this.getX(), y + XBjczJpanelxsjm.this.getY(), XBjczJpanelxsjm.this.getWidth(), XBjczJpanelxsjm.this.getHeight());
                }

            }
        });
    }

    @Override
    public void mouseClicked(MouseEvent e) {
    }

    @Override
    public void mousePressed(MouseEvent e) {
        Music.addyinxiao("关闭窗口.mp3");
        if (e.isMetaDown()) {
            FormsManagement.HideForm(3100);

        } else {
            FormsManagement.Switchinglevel(3100);
        }

        this.first_x = e.getX();
        this.first_y = e.getY();
    }


    @Override
    public void mouseReleased(MouseEvent e) {
    }

    @Override
    public void mouseEntered(MouseEvent e) {
    }

    @Override
    public void mouseExited(MouseEvent e) {
    }

    public XBjczJpanel getXBjczJpanel() {
        return this.xBjczJpanel;
    }

    public void setXBjczJpanel(XBjczJpanel xBjczJpanel) {
        this.xBjczJpanel = xBjczJpanel;
    }
}
